import 'package:flutter/material.dart';

class AddressList extends StatefulWidget {
  @override
  State<AddressList> createState() => _AddressListState();
}

class _AddressListState extends State<AddressList> {
  bool _checked = false;
  @override
  Widget build(BuildContext context) {
    return ListView(children: [
      Container(
          child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Container(
                padding: EdgeInsets.only(left: 15, top: 15),
                child: Text('收货人：三四十'),
              ),
              Container(
                padding: EdgeInsets.only(right: 15),
                child: Text('177777777777'),
              )
            ],
          ),
          Wrap(children: [
            Container(
              padding: EdgeInsets.only(left: 15, right: 15),
              margin: EdgeInsets.only(top: 10),
              child: Text('详细收货地址'),
            )
          ]),
          Container(
            margin: EdgeInsets.only(top: 10, bottom: 10),
            padding: EdgeInsets.only(left: 15, right: 15),
            child: Divider(
              color: Color.fromRGBO(225, 225, 225, 1),
            ),
          ),
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Row(
                children: [
                  Container(
                    margin: EdgeInsets.only(left: 10),
                    child: Checkbox(
                        visualDensity: VisualDensity.compact,
                        materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
                        value: this._checked,
                        onChanged: (value) {
                          setState(() {
                            this._checked = value;
                          });
                        }),
                  ),
                  Container(
                    child: Text('设置默认'),
                  )
                ],
              ),
              Row(
                children: [
                  Row(
                    children: [
                      Container(
                        child: Icon(
                          Icons.edit,
                        ),
                      ),
                      Container(
                        child: Text('编辑'),
                        margin: EdgeInsets.only(left: 3),
                      )
                    ],
                  ),
                  SizedBox(
                    width: 20,
                  ),
                  Row(
                    children: [
                      Container(
                        child: Icon(Icons.delete),
                      ),
                      Container(
                        padding: EdgeInsets.only(right: 15),
                        child: Text('删除'),
                        margin: EdgeInsets.only(left: 3),
                      )
                    ],
                  )
                ],
              )
            ],
          ),
        ],
      )),
      Container(
        margin: EdgeInsets.only(top: 20),
        child: Center(
          child: SizedBox(
            width: 300,
            height: 48,
            child: ElevatedButton(
              style: ElevatedButton.styleFrom(primary: Colors.black),
              onPressed: () {},
              child: Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Icon(
                    Icons.add,
                    color: Colors.white,
                  ),
                  Container(
                    margin: EdgeInsets.only(left: 5),
                    child: Text(
                      '新增收货地址',
                      style: TextStyle(color: Colors.white, fontSize: 16),
                    ),
                  )
                ],
              ),
            ),
          ),
        ),
      )
    ]);
  }
}
